#include <iostream>
#include <stack>
#include <queue>
#include "Queue.h"
#include "Stack.h"
#include "PriorityQueue.h"
using namespace std;

void test_stack()
{
    YX::stack<int> st;

    st.push(1);
    st.push(2);
    st.push(3);
    st.push(4);
    st.push(5);

    while(!st.empty())
    {
        cout<<st.top()<<endl;
        st.pop();
    }
    cout<<endl;
}

void test_queue()
{
    YX::queue<int> q;

    q.push(1);
    q.push(2);
    q.push(3);
    q.push(4);
    q.push(5);
    q.push(6);

    while(!q.empty())
    {
        cout<<q.front()<<endl;
        q.pop();
    }
    cout<<endl;
}

void test_priority_queue()
{
    int a[]={2,6,1,0,3,5,8,9,7};

    YX::priority_queue<int,vector<int>,greater<int>> pq(a,a+sizeof(a)/sizeof(int));

   while(!pq.empty())
   {
       cout<<pq.top()<<endl;
       pq.pop();
   }




}

namespace YX 
{
    struct less 
    {
        template<class T>
        bool operator()(const T& x,const T& y)
        {
            return x<y;
        }
    };

    struct greater 
    {
        template<class T>
        bool operator()(const T& x,const T& y)
        {
            return x>y;
        }
    };
};


//int main()
//{
//    YX::less l;
//    YX::greater g;
//
//    cout<<l(1,2)<<endl;
//    cout<<g(1,2)<<endl;
//    return 0;
//}


int main(int argc,char* argv[],char* env[])
{
    //test_queue();
    //test_stack();
   test_priority_queue();
}
